/**
 * Created by hjqi on 2016/9/30.
 */
module.controller('ClusterPluginController',
    function ($scope,$mdDialog,clusterService) {

    $scope.showAdvanced = function(ev) {
        $mdDialog.show({
                controller: DialogController,
                templateUrl: 'template/cp/clustersPluginStorageInstall.html',
                parent: angular.element(document.body),
                targetEvent: ev,
                clickOutsideToClose:true,
                fullscreen: true // Only for -xs, -sm breakpoints.
            })
            .then(function(isInstall) {

                if(isInstall){
                    //TODO
                    // install storage service in remote cluaster

                }

                //$scope.status = 'You said the information was "' + answer + '".';
            }, function() {
                $scope.status = 'You cancelled the dialog.';
            });
    };

    function DialogController($scope, $mdDialog) {
        $scope.hide = function() {
            $mdDialog.hide();
        };

        $scope.cancel = function() {
            $mdDialog.cancel();
        };

        $scope.answer = function(isInstall) {
            $mdDialog.hide(isInstall);
        };
    }

});
